package net.peelmeagrape.hibernate.sql;

import net.peelmeagrape.hibernate.xmlgen.XmlAttribute;
import net.peelmeagrape.hibernate.xmlgen.XmlElement;
import net.peelmeagrape.hibernate.xmlgen.ChildElement;

import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Retention(RUNTIME)
@XmlElement(name="return-property")
public @interface Return
{
    @XmlAttribute String alias() default "";
    @XmlAttribute("entity-name") String entityName() default "";
    @XmlAttribute("class") Class[] clazz() default {};
    @XmlAttribute("lock-mode") LockMode lockMode() default LockMode.READ;

    @ChildElement(0) ReturnDiscriminator[] discriminator() default {};
    @ChildElement(1) ReturnProperty[] properties() default {};
}
